package aures.ui;

import org.gnome.gtk.CellRendererText;
import org.gnome.gtk.DataColumn;
import org.gnome.gtk.DataColumnString;
import org.gnome.gtk.HBox;
import org.gnome.gtk.Label;
import org.gnome.gtk.ListStore;
import org.gnome.gtk.SortType;
import org.gnome.gtk.TreeIter;
import org.gnome.gtk.TreeView;
import org.gnome.gtk.TreeViewColumn;

public class AuresLobby extends AuresPage {

	public AuresLobby(String src, String root, String title) throws Exception {
		super(src, root, title);
		
		TreeView tvtables = (TreeView) this.getWidget("tvTables");
		TreeView tvusers = (TreeView) this.getWidget("tvUsers");
		TreeIter row;
		CellRendererText renderer;
		TreeViewColumn vertical;

		DataColumnString Users;
		DataColumnString tables_num;
		DataColumnString tables_name;
		DataColumnString tables_type;
		DataColumnString tables_bbb;
		DataColumnString tables_numplayers;
		DataColumnString tables_desc;
		
		ListStore model = new ListStore(new DataColumn[] {
				tables_num = new DataColumnString(),
				tables_name = new DataColumnString(),
				tables_type = new DataColumnString(),
				tables_bbb = new DataColumnString(),
				tables_numplayers = new DataColumnString(),
				tables_desc = new DataColumnString()
				
        });
		
		
		row = model.appendRow();
		model.setValue(row, tables_num, "1");
		model.setValue(row, tables_name, "#BluffTheora");
		model.setValue(row, tables_type, "no-limit");
		model.setValue(row, tables_bbb, "5/10$");
		model.setValue(row, tables_numplayers, "4/4");
		model.setValue(row, tables_desc, "Pro table ! No retards");
		
		row = model.appendRow();
		model.setValue(row, tables_num, "10");
		model.setValue(row, tables_name, "#Saloon");
		model.setValue(row, tables_type, "no-limit");
		model.setValue(row, tables_bbb, "50/100$");
		model.setValue(row, tables_numplayers, "5/6");
		model.setValue(row, tables_desc, "Cowboys only");
		
		row = model.appendRow();
		model.setValue(row, tables_num, "39");
		model.setValue(row, tables_name, "#LostAs");
		model.setValue(row, tables_type, "limit");
		model.setValue(row, tables_bbb, "10/20$");
		model.setValue(row, tables_numplayers, "6/6");
		model.setValue(row, tables_desc, "Make ca$h ! Join US");
		
		tvtables.setModel(model);
		
		vertical = tvtables.appendColumn();
		vertical.setTitle("#");
		renderer = new CellRendererText(vertical);
		renderer.setMarkup(tables_num);
		
		vertical = tvtables.appendColumn();
		vertical.setTitle("Name");
		renderer = new CellRendererText(vertical);
		renderer.setMarkup(tables_name);
		
		vertical = tvtables.appendColumn();
		vertical.setTitle("Type");
		renderer = new CellRendererText(vertical);
		renderer.setMarkup(tables_type);
		
		vertical = tvtables.appendColumn();
		vertical.setTitle("B/BB");
		renderer = new CellRendererText(vertical);
		renderer.setMarkup(tables_bbb);
		
		vertical = tvtables.appendColumn();
		vertical.setTitle("Players");
		renderer = new CellRendererText(vertical);
		renderer.setMarkup(tables_numplayers);
		
		vertical = tvtables.appendColumn();
		vertical.setTitle("Topic");
		renderer = new CellRendererText(vertical);
		renderer.setMarkup(tables_desc);
		
		model.setSortColumn(tables_num, SortType.ASCENDING);
		
		
		model = new ListStore(new DataColumn[] {
				Users = new DataColumnString()
        });
		
		row = model.appendRow();
		model.setValue(row, Users, "Goundy");
		row = model.appendRow();
		model.setValue(row, Users, "Developpez");
		row = model.appendRow();
		model.setValue(row, Users, "Unknown");
		row = model.appendRow();
		model.setValue(row, Users, "Addict");
		row = model.appendRow();
		model.setValue(row, Users, "Tux");
		row = model.appendRow();
		model.setValue(row, Users, "Idler");
		row = model.appendRow();
		model.setValue(row, Users, "Cathy");
		row = model.appendRow();
		model.setValue(row, Users, "Jessy");
		row = model.appendRow();
		model.setValue(row, Users, "Montana");
		
		tvusers.setModel(model);
		
		vertical = tvusers.appendColumn();
		vertical.setTitle("Users");
		renderer = new CellRendererText(vertical);
		renderer.setMarkup(Users);
		
		model.setSortColumn(Users, SortType.ASCENDING);
		
	}
}
